/*
 * @Descripttion:
 * @Author: ziwei
 * @Date: 2022-12-04 12:02:08
 * @LastEditors: ziwei
 * @LastEditTime: 2022-12-04 12:43:14
 */
let person = {
  name: "jw",
  get aliasName() {
    return "**" + this.name + "**";
  },
};

let proxy = new Proxy(person, {
  get(target, key, receiver) {
    console.log(key);
    return Reflect.get(target,key,receiver);
  },
  set(target, key, value, receiver) {
    target[key] = value;
    return Reflect.set(target,key,value,receiver);
  },
});
//这样只监控到了aliasName的取值 name的取值操作监控不到
console.log(proxy.aliasName); //取aiasName的是你 出发了获取name的操作
